import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: () => import('../views/index/Index.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/Register.vue')
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/index/Index.vue'),
    children:[
      {
        path: 'authorization',
        name: 'Authorization',
        component: () => import('../views/index/Authorization.vue')
      },
      {
        path: 'rolemanager',
        name: 'RoleManager',
        component: () => import('../views/index/RoleManager.vue')
      },
      {
        path: 'docmanager',
        name: 'DocManager',
        component: () => import('../views/index/DocManager.vue')
      },
      {
        path: 'mydoc',
        name: 'MyDoc',
        component: () => import('../views/index/MyDoc.vue')
      },
      {
        path: 'userset',
        name: 'UserSet',
        component: () => import('../views/index/UserSet.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
